import { createRouter, createWebHistory } from "vue-router";


const routes = [
    {
        path: '/',
        component: () => import('../views/Main.vue'),
        redirect: "home",
        children: [
            {
                path: '/',
                name: 'home',
                component: () => import('../views/home/Home.vue'),
            },
            {
                path: '/user',
                name: 'user',
                component: () => import('../views/user/UserView.vue'),
            },
            {
                path: '/statistics',
                name: 'Statistics',
                component: () => import('../views/user/Statistics.vue'),
            },
            {
                path: '/essays',
                name: 'Essays',
                component: () => import('../views/user/Essays.vue'),
            },
            {
                path: '/essays/:essayId',
                name: 'EssaysView',
                component: () => import('../views/user/EssaysView.vue')
            },

        ],
    },
    {
        path: '/essays/:essayId',
        name: 'EssaysView',
        component: () => import('../views/user/EssaysView.vue')
    },
    {
        path: '/login',
        name: "login",
        component: () => import('../views/login/Login.vue'),
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router